import request from '@/utils/request';

// 学院列表
export function collegeList() {
    return request({
        url: '/system/dept/list',
        method: 'get'
    })
}

export interface classList {
    /**
     * 学院id
     */
    deptId: string;
    /**
     * 班级名称
     */
    name: string;
    pageNum?: number;
    pageSize?: number;
    [property: string]: any;
}

// 班级列表
export function classList(data: classList) {
    return request({
        url: '/student/class/list',
        method: 'get',
        params: data
    })
}

export interface stuList {
    /*** 年级*/
    classId: string;
    /*** 学院*/
    collegeId: string;
    /*** 姓名*/
    name: string;
    pageNum?: number;
    pageSize?: number;
    /*** 手机号*/
    phoneNumber: string;
    /*** 学号*/
    stuNum: string;
    [property: string]: any;
}
// 学生列表
export function getStudents(data: stuList) {
    return request({
        url: '/system/student/list',
        method: 'get',
        params: data
    })
}
export function getStu() {
    return request({
        url: '/system/student/list',
        method: 'get'
    })
}


export interface stus {
    /**
     * 既往病史
     */
    anamnesis: string;
    /**
     * 班级
     */
    classId: number;
    /**
     * 学院
     */
    collegeId: number;
    /**
     * 学历
     */
    education: string;
    /**
     * 入学时间
     */
    enrollmentTime: string;
    /**
     * 心理诊断经历
     */
    experience: string;
    /**
     * 家庭情况
     */
    familyInfo: string;
    /**
     * 性别
     */
    gender: string;
    /**
     * 年级
     */
    grade: number;
    /**
     * 用药情况
     */
    medicationSituation: string;
    /**
     * 姓名
     */
    name: string;
    /**
     * 手机号
     */
    phoneNumber: string;
    /**
     * 心理普测
     */
    psychometricTest: string;
    /**
     * 其他
     */
    remark: string;
    /**
     * 状态
     */
    status: string;
    /**
     * 学号
     */
    stuNum: string;
    [property: string]: any;
}
// 添加学生
export function addStudents(data:stus) {
    return request({
        url: '/system/student/add',
        method: 'post',
        data: data
    })
}


// 删除学生
export function delStudents(id) {
    return request ({
        url: '/system/student/remove',
        method: 'delete',
        data: id
    })
}

export interface ids {
    studentId: string;
    [property: string]: any;
}
// 重置学生密码
export function resetStudents(id:ids) {
    return request({
        url: '/system/student/resetPwd',
        method: 'post',
        params: id
    })
}

// 编辑
export function editStudents(data) {
    return request({
        url: '/system/student/edit',
        method: 'post',
        data: data
    })
}


//导入
export function uploadStudents(file) {
    return request({
        url: '/system/student/import',
        method: 'post',
        data: file
    })
}

// 下载模板
export function download() {
    return request({
        url: '/system/student/export',
        method: 'post'
    })
}
